import { Component, OnInit, Input } from "@angular/core";
import { ModalController } from '@ionic/angular';
declare let $: any;
@Component({
  selector: "app-business-modal",
  templateUrl: "./business-modal.component.html",
  styleUrls: ["./business-modal.component.scss"],
})
export class BusinessModalComponent implements OnInit {
  @Input() tagData: any;
  businessList = [];

  styleObj = {};

  constructor(
    public modalController: ModalController,

  ) {}

  ngOnInit() {
    this.businessList = this.tagData.data.data;
    const cssStyle = this.tagData.data.cssStyle;
    if (cssStyle) {
      cssStyle.split(",").forEach((item) => {
        const tempArr = item.match(/(.*)\:(.*)/);
        this.styleObj[tempArr[1]] = tempArr[2];
      });
    }
    $("#business-model").fadeIn(250);
  }

  closeClick() {
    $("#business-model").fadeOut(250);
    setTimeout(() => {
      this.modalController.dismiss();
    }, 250);

  }
}
